package com.han.verifycode;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.han.verifycode.ver.conf.*;
import lombok.Data;

/**
 * 这里为了反序列化自动指定子类
 */
@Data
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME,include =   JsonTypeInfo.As.PROPERTY,property = "type")
@JsonSubTypes({@JsonSubTypes.Type(value=TextConf.class,name = "Text"),
        @JsonSubTypes.Type(value=FixKeyPairConf.class,name = "FixedKeyPair"),
        @JsonSubTypes.Type(value=CalcNumConf.class,name = "CalcNum"),
        @JsonSubTypes.Type(value=IdiomPointConf.class,name = "IdiomPoint"),
        @JsonSubTypes.Type(value=PicturePointConf.class,name = "PicturePoint"),
        @JsonSubTypes.Type(value=PicturePuzzleConf.class,name = "PicturePuzzle")
})
public class CodeConfig {

    /**
     * 图片生成路径
     */
    private String basePath = "/output";

    /**
     * 基本图片大小
     */
    private Integer width = 130;

    /**
     * 高
     */
    private Integer height = 40;

    /**
     * 过期时间 秒
     */
    private Long expireTime;

}
